<!--{template common/header_ajax}-->
<div class="modal-header">
  <h4 class="modal-title text-truncate">{lang set}</h4>
  <div class="float-end">
    <button type="button" class="modal-fullscreen-btn"><i class="mdi"></i></button>
    <button type="button" class="btn-close" data-dismiss="modal" aria-label="Close"></button>
  </div>
</div>
<div class="modal-body">
  <form action="{MOD_URL}&op=admin" class="form-horizontal cpform" method="post" name="cpform">
    <input type="hidden" value="{FORMHASH}" name="formhash">
    <input type="hidden" name="confirmsubmit" value="true" />
    <div class="row mb-3">
      <label class="col-sm-2">导入方式设置</label>
      <div class="col-sm-10">
        <div class="form-check form-check-inline">
          <input class="form-check-input" type="radio" id="org_import_user1" name="org_import_user" <!--{if $_G['setting']['org_import_user']}-->checked="checked"<!--{/if}--> value="1">
          <label class="form-check-label" for="org_import_user1">{lang yes}</label>
        </div>
        <div class="form-check form-check-inline">
          <input class="form-check-input" type="radio" id="org_import_user2" name="org_import_user" <!--{if !$_G['setting']['org_import_user']}-->checked="checked"<!--{/if}--> value="0">
          <label class="form-check-label" for="org_import_user2">{lang no}</label>
        </div>
        <span class="form-text">是否允许机构部门管理员使用覆盖方式导入，允许后，新数据将覆盖原有用户信息；因用户可能归属多个部门，覆盖可能导致其他部门关联的用户数据异常，请谨慎开启。</span>
      </div>
    </div>
  </form>
</div>
<div class="modal-footer">
  <button type="button" class="btn btn-secondary" data-dismiss="modal" aria-label="Close">{lang close}</button>
  <button type="button" class="btn btn-primary" id="adduser_submit" onclick="account_submit()">{lang save_changes}</button>
</div>
<script type="text/javascript" reload="1">
  function account_submit() {
    showmessage('{lang In_the_save}','','3000',0);
    var formData = $('.cpform').serialize();
    jQuery.post('{MOD_URL}&op=ajax&do=set&ajaxdata=json',formData, function (data) {
      if (data['success']) {
        showmessage('{lang save_success}','success',3000,1);
      }else if(data['message']){
        showmessage(data['message'],'danger',3000,1);
      } else {
        showmessage('{lang save_unsuccess}','danger',3000,1);
      }
    },'json').fail(function (jqXHR, textStatus, errorThrown) {
        showmessage('{lang do_failed}', 'error', 3000, 1);
    });
  }
</script>
<!--{template common/footer_ajax}-->